from flask_restx import Namespace, Resource, fields

# 创建命名空间
user_review_ns = Namespace('user-review', description='用户审核管理API')

# 定义模型
review_user_model = user_review_ns.model('ReviewUser', {
    'status': fields.Integer(required=True, description='审核结果：1通过，3不通过'),
    'reason': fields.String(description='审核不通过原因')
})

batch_review_model = user_review_ns.model('BatchReview', {
    'user_ids': fields.List(fields.Integer, required=True, description='用户ID列表'),
    'status': fields.Integer(required=True, description='审核结果：1通过，3不通过'),
    'reason': fields.String(description='审核不通过原因')
})

# API文档路由
@user_review_ns.route('/pending')
class PendingUsersDoc(Resource):
    @user_review_ns.doc('get_pending_users')
    @user_review_ns.param('page', '页码', type='int', default=1)
    @user_review_ns.param('per_page', '每页数量', type='int', default=20)
    @user_review_ns.param('keyword', '搜索关键词', type='str')
    def get(self):
        """获取待审核用户列表"""
        pass

@user_review_ns.route('/<int:user_id>')
class UserReviewDoc(Resource):
    @user_review_ns.doc('review_user')
    @user_review_ns.expect(review_user_model)
    def put(self, user_id):
        """审核用户"""
        pass

@user_review_ns.route('/batch')
class BatchUserReviewDoc(Resource):
    @user_review_ns.doc('batch_review_users')
    @user_review_ns.expect(batch_review_model)
    def put(self):
        """批量审核用户"""
        pass

@user_review_ns.route('/<int:user_id>/detail')
class UserReviewDetailDoc(Resource):
    @user_review_ns.doc('get_user_review_detail')
    def get(self, user_id):
        """获取用户审核详情"""
        pass

@user_review_ns.route('/statistics')
class ReviewStatisticsDoc(Resource):
    @user_review_ns.doc('get_review_statistics')
    def get(self):
        """获取审核统计数据"""
        pass 